(function (object) {
	//外部方法
	object.base={
		init:function(){
			_func.init();
		}
	}
	//内部方法
	var _func = {
		init:function(){
			_func.getWariningMsg();
			setInterval(function () {
                _func.getWariningMsg();
            },300000);
		},
		getWariningMsg : function(){
			if(undefined != _platform){
				path = _platform+"/json_warninginfo";
				window.Util.ajax.post(path,null,function(data){
					if(data.result){
						$("#sum_waring").text(data["sum_waring"]==undefined?"0":data["sum_waring"]);
//						$("#sum_allOrder").text(data["sum_allOrder"]==undefined?"0":data["sum_allOrder"]);
						$("#sum_orderComplaint").text(data["sum_orderComplaint"]==undefined?"0":data["sum_orderComplaint"]);
						$("#sum_otherComplaint").text(data["sum_otherComplaint"]==undefined?"0":data["sum_otherComplaint"]);
						$("#sum_orderGoods").text(data["sum_orderGoods"]==undefined?"0":data["sum_orderGoods"]);
						if(data["sum_orderGoods"] != undefined && data["sum_orderGoods"] > 0){
							var _parent = $("#sum_orderGoods").parent();
							_parent.attr("href",_parent.data("href"));
						}else{
							var _parent = $("#sum_orderGoods").parent();
							_parent.attr("href","#");
						}
						$("#sum_orderMonth").text(data["sum_orderMonth"]==undefined?"0":data["sum_orderMonth"]);
						if(data["sum_orderMonth"] != undefined && data["sum_orderMonth"] > 0){
							var _parent = $("#sum_orderMonth").parent();
							_parent.attr("href",_parent.data("href"));
						}else{
							var _parent = $("#sum_orderMonth").parent();
							_parent.attr("href","#");
						}
						$("#sum_overdueMonth").text(data["sum_overdueMonth"]==undefined?"0":data["sum_overdueMonth"]);
						if(data["sum_overdueMonth"] != undefined && data["sum_overdueMonth"] > 0){
							var _parent = $("#sum_overdueMonth").parent();
							_parent.attr("href",_parent.data("href"));
						}else{
							var _parent = $("#sum_overdueMonth").parent();
							_parent.attr("href","#");
						}
					}
				});
			}
		}
	}
})(window.views = window.views || {});

$(function(){
	window.views.base.init();
});